package com.itheima.clientAndService01;

public class MainClass01 {
    public static void main(String[] args) {
        int num = 5;
        int s = getSum(num);
        System.out.println(s);
    }

    private static int getSum(int num) {
        if (num == 1){
            return 1;
        }else {
            return num * getSum(num - 1);
        }
    }
}
